From: Jasper St. Pierre Date: Mon, 26 Aug 2013 19:21:45 +0000 (-0400) Subject: popupMenu: Make the section invisible if it has no visible children X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~3579 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=5a0ac6c2ac5686c679988c2ca922ed758d2b19f1;p=gnome-shell.git popupMenu: Make the section invisible if it has no visible children https://bugzilla.gnome.org/show_bug.cgi?id=706852 --- diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index e720c6720..1fe78f74c 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -921,10 +921,19 @@ const PopupMenuSection = new Lang.Class({ this.isOpen = true; }, + _syncVisibility: function() { + this.actor.visible = !this.isEmpty(); + }, + // deliberately ignore any attempt to open() or close(), but emit the // corresponding signal so children can still pick it up - open: function() { this.emit('open-state-changed', true); }, - close: function() { this.emit('open-state-changed', false); }, + open: function() { + this._syncVisibility(); + this.emit('open-state-changed', true); + }, + close: function() { + this.emit('open-state-changed', false); + }, }); const PopupSubMenuMenuItem = new Lang.Class({